<!DOCTYPE html>
<html>
<head>
    <title>Array Type Example 3</title>
    <script type="text/javascript">
        
        var colors = ["red", "blue", "green"];    //creates an array with three strings
        colors.length = 2;
        alert(colors[2]);        //undefined

    </script>
</head>
<body>

</body>
</html>